



        <div class="info-box">
        <?php 
			$ExpirationDateYear = array();
	        //make Year selection
	        $yearDate = (int)date('Y');
	        $yearDateArr = array();
	        for($i=0;$i<=14;$i++){
	        	$ExpirationDateYear[$yearDate + $i] = $yearDate + $i;
	        }
	        $ExpirationDateMonth = array(
	        		'1'=>'Jan',
	        		'2'=>'Feb',
	        		'3'=>'Mar',
	        		'4'=>'Apr',
	        		'5'=>'May',
	        		'6'=>'Jun',
	        		'7'=>'Jul',
	        		'8'=>'Aug',
	        		'9'=>'Sep',
	        		'10'=>'Oct',
	        		'11'=>'Nov',
	        		'12'=>'Dec',
	        );
	        $form=$this->beginWidget('CActiveForm', array(
	        		'id'=>'products-form',
	        		'enableAjaxValidation' => false,
	        		'enableClientValidation' => true,
	        		'clientOptions' => array(
	        				'validateOnSubmit' => true
	        		),
        	)); 
	      ?>
        	<input type="hidden" value="<?php echo $bidPackId;?>" name="CustomerOrderBillingInfo[bidPackId]" />
        	<input type="hidden" value="<?php echo Yii::app()->request->getParam('couponCode',null)?>" name="CustomerOrderBillingInfo[coupon_code]" />
        	<input type="hidden" value="<?php echo $model->id?>" name="CustomerOrderBillingInfo[billing_id]" />
        	<div class="payment-method">
            	<p class="title">Select Payment method</P>
                <ul>
	                <li>
	                	<?php echo $form->radioButton($model,'billing_payby',array('value'=>PayPal::API_NAME, 'uncheckValue'=>null,'id'=>PayPal::API_NAME)); ?>
	                	<img alt="" src="<?php echo $baseUrl ?>/images/paypal.png" />
	                </li>
	                <li>
	                	<?php echo $form->radioButton($model,'billing_payby',array('checked'=>'true','value'=>AuthorizeNet::API_NAME, 'uncheckValue'=>null,'id'=>AuthorizeNet::API_NAME)); ?>
	                	<img alt="" src="<?php echo $baseUrl ?>/images/bank-card.png" />
	                </li>
                </ul>
            </div>
            <div class="billing-address">
            	<p class="title">Billing Address</P>
                <ul>
	                <li>
	                	<?php echo $form->label($model,'First Name'); ?>
	                	<?php echo $form->textField($model,'billing_first_name'); ?>
	                	<?php echo $form->error($model,'billing_first_name'); ?>
	                </li>
	                <li>
	                	<?php echo $form->label($model,'Last Name'); ?>
	                	<?php echo $form->textField($model,'billing_last_name'); ?>
	                	<?php echo $form->error($model,'billing_last_name'); ?>
	                </li>
	                <li>
	                	<?php echo $form->label($model,'Address'); ?>
	                	<?php echo $form->textField($model,'billing_address1'); ?>
	                	<?php echo $form->error($model,'billing_address1'); ?>
	                </li> 
	                <li>
	                	<?php echo $form->label($model,'City'); ?>
	                	<?php echo $form->textField($model,'billing_city'); ?>
	                	<?php echo $form->error($model,'billing_city'); ?>
	                </li>
	                <li>
	                	<?php echo $form->labelEx($model,'Country'); ?>
	                	<?php echo $form->dropDownList($model, 'billing_country', CHTML::listData(Country::model()->findAll('id=10'),'id','name')); ?>
	                </li>
	                <li>
	                	<?php echo $form->labelEx($model,'State'); ?>
	                	<?php echo $form->dropDownList($model, 'billing_state', CHTML::listData(State::model()->findAll('country_id=10'),'id','name'),array('select'=>$model->billing_state)); ?>
	                </li>
	                <li>
	                	<?php echo $form->label($model,'Zip'); ?>
	                	<?php echo $form->textField($model,'billing_zip'); ?>
	                	<?php echo $form->error($model,'billing_zip'); ?>
	                </li>
	                <li>
	                	<?php echo $form->label($model,'Email'); ?>
	                	<?php echo $form->textField($model,'billing_email',array('value'=>Yii::app()->user->userInfo()->email)); ?>
	                	<?php echo $form->error($model,'billing_email'); ?>
	                </li>
	                 <li>
	                	<?php echo $form->label($model,'Phone'); ?>
	                	<?php echo $form->textField($model,'billing_phone'); ?>
	                	<?php echo $form->error($model,'billing_phone'); ?>
	                </li>
                </ul>
            </div>
            <div class="clear"></div>
            <div class="billing-address patment-details">
            	<p class="title">Payment Details</P>
                <ul>
	                <li>
	                	<?php echo $form->label($model,'Card Number'); ?>
                		<?php echo $form->textField($model,'credit_card_num',array('value'=>'')); ?>
	                	<?php echo $form->error($model,'credit_card_num'); ?>
	                </li>
	                <li>
	                	<?php echo $form->label($model,'Exp.date'); ?>
	                	<?php echo $form->dropDownList($model,'credit_card_exp_month',$ExpirationDateMonth,array('style'=>'width:130px;')); ?>
	                	<?php echo $form->dropDownList($model,'credit_card_exp_year',$ExpirationDateYear,array('style'=>'width:130px;')); ?>
	                </li>
	                <li>
	                	<?php echo strtoupper($form->label($model,'CVV')); ?>
                		<?php echo $form->textField($model,'credit_card_cvv',array('style'=>'width:130px;')); ?>
	                	<?php echo $form->error($model,'credit_card_cvv'); ?>
	                	<span>(where do I get these 3 digits)</span>
	                </li>
                </ul>
            </div>
            <div class="payment-btn">
              <?php echo CHtml::imageButton($baseUrl."/images/button-ready-to-start.png",
				array('class' => 'ready-winning-btn',
					  'submit' => $this->createUrl('/payment/buybidpack'),
						))?>
			</div>
<?php $this->endWidget(); ?>
		<form id="paypal-form" style="display:none;" method="post">
			<div class="payment-paypal-btn">
			<input type="hidden" value="<?php echo $bidPackId;?>" name="CustomerOrderBillingInfo[bidPackId]" />
        	<input type="hidden" value="<?php echo Yii::app()->request->getParam('couponCode',null)?>" name="CustomerOrderBillingInfo[coupon_code]" />
        	<input id="PayPal-1" type="radio" name="CustomerOrderBillingInfo[billing_payby]" value="PayPal" style="display:none;" checked>
	              <?php echo CHtml::imageButton($baseUrl."/images/ready-winning-btn.png",
					array('class' => 'ready-winning-btn',
						  'submit' => $this->createUrl('/payment/buybidpack'),
				  ))?>
			</div>
		</form>
        </div>
<script>
$(document).ready(function(){
	$('#PayPal').click(function(){
		$('.billing-address').hide();
		$('.billing-address patment-details').hide();
		$('.payment-btn').hide();
		$('#paypal-form').show();
		$('#PayPal-1').attr('checked','true');
	});
	$('#AuthorizeNet').click(function(){
		$('.billing-address').show();
		$('.billing-address patment-details').show();
		$('.payment-btn').show();
		$('#paypal-form').hide();
		$('#PayPal-1').attr('checked','false');
	});
});
</script>